﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Synergy
{
    public partial class Form选择工艺路线 : Form
    {
        public string PRoutingIds { set; get; }
        public string 工艺路线ID { get; set; }
        public Form选择工艺路线()
        {
            InitializeComponent();
        }

        private void Form选择工艺路线_Load(object sender, EventArgs e)
        {
            DataTable dt = SqlSugarHelp.scope.Ado.GetDataTable($"select  PRoutingId,dbo.sfc_prouting.Version ,dbo.sfc_prouting.VersionDesc from sfc_prouting where PRoutingId in ('{PRoutingIds}')");
            this.dataGridView1.DataSource = dt;
            this.dataGridView1.Refresh();
        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            //如果点击确定
            if (e.RowIndex >= 0 && dataGridView1.Columns[e.ColumnIndex].Name == "C确定")
            {
                工艺路线ID = this.dataGridView1.Rows[e.RowIndex].Cells["C工艺路线ID"].Value.ToString();
                this.DialogResult = DialogResult.OK;
            }
        }
    }
}
